package com.zhiyou.app.common.constant;

import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;

import java.util.List;

@Slf4j
public class CommonPageUtil {
    public static<T, D> PageInfo<D> pageCovert(List<T> oldList, List<D> newList){
        PageInfo<T> oldPageInfo = new PageInfo<>(oldList);
        PageInfo<D> newPageInfo = new PageInfo<>();
        BeanUtils.copyProperties(oldPageInfo, newPageInfo);
        newPageInfo.setList(newList);
        return newPageInfo;

    }
}
